package com.ruoyi.demo.controller;

import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.demo.DTO.MeetUserDetailDTO;
import com.ruoyi.demo.service.impl.MeetUserDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo/meetUserDetail")
public class MeetUserDetailController {
    @Autowired
    private MeetUserDetailService meetUserDetailService;

    // 根据meet_id获取会议及参会人员信息
    @GetMapping("/{meetId}")
    public ResponseEntity<MeetUserDetailDTO> getMeetDetails(@PathVariable("meetId") Long meetId) {
        MeetUserDetailDTO meetUserDetail = meetUserDetailService.getMeetDetails(meetId);
        if (meetUserDetail != null) {
            return ResponseEntity.ok(meetUserDetail);
        } else {
            return ResponseEntity.status(HttpStatus.NOT_FOUND).body(null);
        }
    }
}
